package sort

func selectionSort(arr []int) {
	if len(arr) <= 1 {
		return
	}

	length := len(arr)
	for i := 0; i < length; i++ {
		index := i
		for j := i; j < length; j++ {
			if arr[j] < arr[index] {
				index = j
			}
		}
		arr[i], arr[index] = arr[index], arr[i]
	}
}
